# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
_php=php7
pkgname=${_php}-pear-net_smtp
_pkgreal=Net_SMTP
pkgver=1.9.0
pkgrel=0
pkgdesc="An implementation of the SMTP protocol"
url="http://pear.php.net/package/Net_SMTP"
arch="noarch"
license="BSD-2-Clause"
depends="${_php}-pear ${_php}-pear-net_socket"
options="!check"
subpackages="$pkgname-doc"
source="http://download.pear.php.net/package/$_pkgreal-$pkgver.tgz"
builddir="$srcdir"/$_pkgreal-$pkgver

_phpdir="usr/share/${_php}"

package() {
	cd "$builddir"
	for dir in doc example test; do
		install -d "$pkgdir"/$_phpdir/$dir/$_pkgreal
	done
	mv docs "$pkgdir"/$_phpdir/doc/$_pkgreal
	mv examples "$pkgdir"/$_phpdir/example/$_pkgreal
	mv tests "$pkgdir"/$_phpdir/test/$_pkgreal
	install -d "$pkgdir"/$_phpdir/PEAR
	mv Net "$pkgdir"/$_phpdir/PEAR
	install -Dm0644 LICENSE "$pkgdir"/$_phpdir/doc/$_pkgreal/LICENSE
}

doc() {
	cd "$builddir"
	install -d "$subpkgdir"/$_phpdir/doc
	mv "$pkgdir"/$_phpdir/doc/$_pkgreal \
		"$subpkgdir"/$_phpdir/doc
}

sha512sums="fb28bbf07e54d71d1a82d59b137e4905c77b5600c10cf7760890ec708fc9e6df9d47715cf6808569f88603fac80c1cfdd7c4f3893efe7ac7aecaac47ba849ec2  Net_SMTP-1.9.0.tgz"
